package day03;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/show/*")
public class ForwardServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("ForwardServlet.service()");


        String path=request.getRequestURI();

        path=path.substring((request.getContextPath()+request.getServletPath()).length());

        request.getRequestDispatcher("/WEB-INF"+path+".jsp").forward(request,response);

    }
}
